#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QtSql>
#include <iostream>
#include <QTableView>
using namespace std;

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QSqlDatabase baza = QSqlDatabase::addDatabase("QSQLITE");
    baza.setDatabaseName("mydatabase.sqlite");


    MainWindow w;

    QSqlTableModel model0;
    model0.setTable("Voronov");
    model0.select();
    w.tablica0.setModel(&model0);

    QSqlTableModel model1;
    model1.setTable("Facultets");
    model1.select();
    w.tablica1.setModel(&model1);

    QSqlTableModel model2;
    model2.setTable("Groops");
    model2.select();
    w.tablica2.setModel(&model2);


    w.lay.addWidget(&w.tablica0);
    w.lay.addWidget(&w.tablica1);
    w.lay.addWidget(&w.tablica2);

    w.wid.setLayout(&w.lay);
    w.setCentralWidget(&w.wid);




    w.show();

    
    return a.exec();
}
